package cn.com.sise.service.impl;

import cn.com.sise.dao.FavoritesDao;
import cn.com.sise.pojo.Dictionary;
import cn.com.sise.pojo.Resources;
import cn.com.sise.service.FavoritesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FavoritesServiceImpl implements FavoritesService {
    private FavoritesDao favoritesDao;

    @Autowired
    public void setFavoritesDao(FavoritesDao favoritesDao) {
        this.favoritesDao = favoritesDao;
    }

    public String insertFavoritesDictionary(Integer dictionaryId, Integer userId) {
        return favoritesDao.insertFavoritesDictionary(dictionaryId, userId);
    }

    public String insertFavoritesResources(Integer resourceId, Integer userId) {
        return favoritesDao.insertFavoritesResources(resourceId, userId);
    }

    public String deleteFavoritesDictionary(Integer dictionaryId) {
        return favoritesDao.deleteFavoritesDictionary(dictionaryId);
    }

    public String deleteFavoritesResources(Integer resourceId) {
        return favoritesDao.deleteFavoritesResources(resourceId);
    }

    public List<Dictionary> selectDictionaryByUserId(int user_id) {
        return favoritesDao.selectDictionaryByUserId(user_id);
    }

    public List<Resources> selectResourceByUserId(int user_id) {
        return favoritesDao.selectResourceByUserId(user_id);
    }


}
